package com.zorn.platform.component.action;

import com.zorn.core.provider.ActionSupportProvider;
import com.zorn.platform.component.service.IComponentService;

public class ComponentAction extends ActionSupportProvider {

	/* Fields
	================================================== */
	private IComponentService componentService;

	/* Methods
	================================================== */
	public String query() {
		componentService.query(getParameterMap());

		setJSONObject(componentService.getResult());

		return JSON_RESULT;
	}

	public String count() {
		componentService.count(getParameterMap());

		setJSONObject(componentService.getResult());

		return JSON_RESULT;
	}

	public String insert() {
		componentService.insert(getParameterMap());

		setJSONObject(componentService.getResult());

		return JSON_RESULT;
	}

	public String update() {
		componentService.update(getParameterMap());

		setJSONObject(componentService.getResult());

		return JSON_RESULT;
	}

	public String delete() {
		componentService.delete(getParameterMap());

		setJSONObject(componentService.getResult());

		return JSON_RESULT;
	}

	/* Getters & Setters
	================================================== */
	public void setComponentService(IComponentService componentService) {
		this.componentService = componentService;
	}

}